package com.example.actordemo1;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import com.example.actordemo1.config.SpringExtension;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

@Component
public class InitRun implements CommandLineRunner {
    @Autowired
    private ApplicationContext applicationContext;
    @Autowired
    ActorSystem actorSystem;
    @Autowired
    SpringExtension springExtension;
    @Override
    public void run(String... args) throws Exception {
       actorSystem.actorOf(springExtension.props("remoteActor"), "remoteActor");

    }
}
